<template>
    <div class="ma-content-block p-10">
        <a-form ref="formRef" :model="form" @submit="handleSubmit">
            <a-form-item field="payment_service" label="平台服务费" label-col-flex="auto" :label-col-style="{ width: '85px' }">
                <a-input-number v-model="form.payment_service" placeholder="平台服务费（百分比）" />
            </a-form-item>
            <a-form-item hide-label>
                <a-button type="primary" style="margin-right:20px;" html-type="submit">立即提交</a-button>
                <a-button type="outline" @click="$refs.formRef.resetFields()">重置</a-button>
            </a-form-item>
        </a-form>
    </div>
</template>
<script  setup>
import request from "@/api/base/setting";
import { Message } from "@arco-design/web-vue";
import { ref } from "vue";
const form = ref({
    key: "order",
    payment_service: 0
});

const get_list = async () => {
    let { data } = await request.get_deta({
        key: form.value.key
    });
    form.value.payment_service = data?.payment_service;
};
get_list();

const handleSubmit = async () => {
    await request.save(form.value);
    Message.success("保存成功");
};
</script>